package net.sudot.chess.business.model;

import lombok.Getter;
import lombok.Setter;
import lombok.experimental.Accessors;

import javax.persistence.Entity;
import javax.persistence.EnumType;
import javax.persistence.Enumerated;
import javax.persistence.Table;

/**
 * 积分记录
 *
 * @author tangjialin on 2018-03-05.
 */
@Getter
@Setter
@Accessors(chain = true)
@Entity
public class PointRecord extends BaseEntity<PointRecord> {

    /** 类型 */
    public enum Type {
        REWARD("赠送"),
        SIGN("签到"),
        RECHARGE("充值"),
        GAME("游戏");
        private String memo;

        Type(String memo) {
            this.memo = memo;
        }

        public String memo() {
            return memo;
        }
    }

    /** 用户 */
    private Long userId;
    /** 类型 */
    @Enumerated(EnumType.STRING)
    private PointRecord.Type type;
    /** 积分数 */
    private Long point;
    /** 当前积分 */
    private Long balance;
    /** 备注 */
    private String memo;

}
